#ifndef _NAND_DEFINE_H
#define _NAND_DEFINE_H

typedef enum
{
	NAND_START_READ					= 0x00,
	NAND_END_PROGRAM				= 0x10,
	NAND_END_READ					= 0x30,
	NAND_END_READ_COPY_BACK			= 0x35,
	NAND_START_ERASE				= 0x60,
	NAND_READ_STATUS				= 0x70,
	NAND_READ_STATUS_EDC			= 0x7B,
	NAND_START_PROGRAM				= 0x80,
	NAND_START_PROGRAM_COPY_BACK	= 0x85,
	NAND_READ_ID					= 0x90,
	NAND_END_ERASE					= 0xD0,
	NAND_HI_Z						= 0xEE,
	NAND_IO_OK						= 0xFE,
	NAND_RESET						= 0xFF
} NAND_command_t;

typedef enum
{
	COMMAND		= 1,
	COL_ADDR0	= 2,
	COL_ADDR1	= 3,
	ROW_ADDR0	= 4,
	ROW_ADDR1	= 5,
	WR_DATA		= 6,
	RD_DATA		= 7,
	ERASE_DATA	= 8,
	CONFIRM		= 9,
	READ_STATUS	= 10
} NAND_state_t;

const unsigned NAND_PAGE_SIZE	= 4096;

const unsigned NAND_CH1_START_LBA	= 0x0;
const unsigned NAND_CH2_START_LBA	= 0x8000;

#endif
